<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="container">
    <input type="text" id="text" />
</div>
<button type="button"  onclick="printJSON()">打印JSON数据</button>
<script type="text/javascript">

    let clazz1 = {
        oneclass : [
            {
                name:"张三",
                age:22,
                tag:["没礼貌","没脑子"]
            }
        ],//学生对象
        createDate : new Date(),//创建日期
        id : 1,//班级编号
        name : "scnwc",//班级名字
    };
    function printJSON() {
        let text = document.querySelector("#text") ;
        let s=clazz1.name;
        text.value=s;
    }

</script>
</body>
</html>